/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Config;

import CrlException.CrlException;

/**
 *
 * @author CUHUUHOANG
 */
public class ConfigSetting {
    //from xml
    public static int maxThread;
    public static int depth;
    public static String hostMySQL;
    public static String databaseName;
    public static String username;
    public static String password;
    public static String ExtractorJarFile;
    public static boolean downloadImage;
    public static boolean useProxy;
    public static String proxyHost;
    public static String proxyPort;
    public static String imageDir;
    public static boolean restartCrawling;
    //get from extractor
    public static String tableName;
    public static String[] allAttribute;
    public static String seedURL;
    public static String imgAttriName;

    public ConfigSetting() {
    }

    public static void SetDefaultValue() throws CrlException {
        try {
            maxThread = 8;
            depth = 0;
            hostMySQL = "jdbc:mysql://localhost:3306/";
            databaseName = "WebCrawlerDB";
            username = "root";
            password = "123456789";
            ExtractorJarFile = "./TedXExtractor.jar";
            downloadImage = true;
            useProxy = false;
            proxyHost = "proxy";
            proxyPort = "8080";
            imageDir = "./Image/";
            restartCrawling=true;
        } catch (Exception e) {
            throw new CrlException(e.getMessage());
        }
    }
}